package domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class Schedule implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id @GeneratedValue
	private long id;
	private Date date;
	private Date startTime;
	private Date endTime;
//	private int numberOfMission;
	@Enumerated(EnumType.STRING)
	private Route route;
	
	@OneToMany(cascade={CascadeType.ALL})
	private List<Mission> missions = new ArrayList<Mission>();
	
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
//	public int getNumberOfMission() {
//		return numberOfMission;
//	}
//	public void setNumberOfMission(int numberOfMission) {
//		this.numberOfMission = numberOfMission;
//	}
	public Route getRoute() {
		return route;
	}
	public void setRoute(Route route) {
		this.route = route;
	}
	public List<Mission> getMissions() {
		return missions;
	}
	public void addMission(Mission s){
		missions.add(s);
	}
	
	
}

